n,m,k=map(int,input().split())

d=[0 for i in range(0,200001)]

for i in range(0,n):
    t,c=map(int,input().split())
    less=max(t-k-c+1,0)
    large=max(t-k,0)
    d[less]+=1
    d[large+1]-=1

for i in range(0,200000):
    d[i+1]+=d[i]

for i in range(0,m):
    q=int(input())
    print(d[q])
